Release 10.1A: OpenEdge Development:
Java Open Clients
Understanding SDOResultSet scrolling modes
Different scrolling modes allow you to control response time, memory requirements, and the ResultSet isolation level. The isolation level (in this context) is the visibility of modifications made to the ResultSet by applications other than the current Open Client. Each mode represents tradeoffs between these requirements and capabilities. You can set the scrolling mode on the
SDOParametersobject using thesetScrollingMode(SDOScrollingModeconstant)method and pass the object to the_createSDOResultSet()factory method. These are the values you can pass forconstant:
Note: If you are accessing a large ResultSet, you might want to use theSDOScrollingMode.PREFETCH— This is the default and only allowable mode for a stateless SDOResultSet. In this mode, the whole ResultSet is fetched into memory when the SDOResultSet object is created. The response time and amount of memory required is directly related to the size of the ResultSet. This mode creates the highest level of isolation. (For more information, see the information on visibility of updates in the "Updating SDOResultSet objects" section.) The size of the ResultSet is known from the beginning and does not change until the ResultSet is closed or the query is reopened. Also, navigation in this mode is guaranteed to be fast since all the rows are in memory. This mode is ideal for small ResultSets in combination with slow networks.setPrefetchMaxRows()method to limit the number of rows you fetch. Otherwise, your Java application can run with an excessively long response time and large memory consumption. This can be a special problem for applications accessing stateless SDOResultSets, which always are in thePREFETCHscrolling mode. For more information, see the "Understanding SDOResultSet stateless mode" section.SDOScrollingMode.KEEP_ROWS— This is the default mode for an SDOResultSet that is not stateless. The rows are not prefetched but retrieved from the AppServer on demand. Rows that were retrieved are kept in memory until the ResultSet is closed or a row is refreshed or updated. The response time to get the first rows inKEEP_ROWSmode is shorter than inPREFETCHmode. Stateless SDOResultSets do not support this mode (see the "Understanding SDOResultSet stateless mode" section).SDOScrollingMode.FORWARD_ONLY— In this mode, only thenext()navigation method is supported; the cursor cannot be randomly repositioned. Since there is no need to maintain an in-memory cache of rows, the amount of required memory does not depend on the size of the ResultSet. This scrolling mode should be used, therefore, when a large ResultSet is accessed and thenext()method is sufficient; no other navigation methods are required.
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |